﻿using System;
using System.Collections.Generic;
using System.Text;
using Maticsoft.DBUtility;
using System.Data;//Please add references
namespace Lawyer.DAL
{
    public class Dashboard
    {
        public int GetCount(string table, string strWhere)
        {
            string sql = "SELECT COUNT(*) FROM " + table + " ";
            if (strWhere.Trim() != "")
            {
                sql += " WHERE " + strWhere;
            }
            DataSet ds = DbHelperSQL.Query(sql);
            int count = 0;
            try
            {
                count = Int32.Parse(ds.Tables[0].Rows[0][0].ToString());
            }
            catch { }
            return count;
        }
    }
}
